package com.karina.visualization.chart.client;

import java.util.List;

import com.karina.visualization.chart.client.LineChartWidget.LineChart;
import com.karina.visualization.chart.component.AreaSeries;
import com.karina.visualization.chart.component.CoordinateChartWidget;
import com.karina.visualization.chart.model.AreaChartModel;
import com.karina.visualization.chart.model.CategorizedSeriesModel;
import com.karina.visualization.chart.model.SeriesModel;

public class AreaChartWidget<DataType> extends
		CoordinateChartWidget<AreaChartModel<DataType>, DataType> {

	static class AreaChart extends LineChart {
		@Override
		public String getSelectorName() {
			return "AreaChart";
		}

		@SuppressWarnings("rawtypes")
		@Override
		protected Series createSeries(SeriesModel model) {
			return new AreaSeries((CategorizedSeriesModel) model);
		}

	}

	public AreaChartWidget() {
		super(new AreaChart());
	}

	@Override
	protected AreaChartModel<DataType> createChartModel(
			List<DataType> dataProvider) {
		return new AreaChartModel<DataType>(dataProvider);
	}

}
